---
platform: linux
image_resource:
  type: registry-image
  source:
    repository: gcr.io/data-gpdb-public-images/gpdb6-centos6-build
    tag: latest

inputs:
- name: gpdb_src
- name: bin_gpdb_centos6
- name: bin_gpdb_centos7
- name: bin_gpdb_ubuntu18.04
- name: bin_gpdb_rhel8

outputs:
- name: output

params:
  RC_BUILD_TYPE_GCS:

run:
  path: bash
  args:
  - -ec
  - |
    server_version="$(./gpdb_src/getversion --short)"
    cp bin_gpdb_centos6/bin_gpdb.tar.gz "output/server-build-${server_version}-rhel6_x86_64${RC_BUILD_TYPE_GCS}.tar.gz"
    cp bin_gpdb_centos7/bin_gpdb.tar.gz "output/server-build-${server_version}-rhel7_x86_64${RC_BUILD_TYPE_GCS}.tar.gz"
    cp bin_gpdb_ubuntu18.04/bin_gpdb.tar.gz "output/server-build-${server_version}-ubuntu18.04_x86_64${RC_BUILD_TYPE_GCS}.tar.gz"
    cp bin_gpdb_rhel8/bin_gpdb.tar.gz "output/server-build-${server_version}-rhel8_x86_64${RC_BUILD_TYPE_GCS}.tar.gz"
